﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Gmantis.Controls.DataGrid
{
    public class DataGridDetailsPresenter : ContentControl
    {
        // Fields
        internal bool _isLoaded;
        public static readonly DependencyProperty HorizontalGridLineBrushProperty = DependencyProperty.Register("HorizontalGridLineBrush", typeof(Brush), typeof(DataGridDetailsPresenter), new PropertyMetadata(new SolidColorBrush()));
        public static readonly DependencyProperty HorizontalGridLineVisibilityProperty = DependencyProperty.Register("HorizontalGridLineVisibility", typeof(Visibility), typeof(DataGridDetailsPresenter), new PropertyMetadata(Visibility.Collapsed));

        // Methods
        public DataGridDetailsPresenter()
        {
            base.DefaultStyleKey = typeof(DataGridDetailsPresenter);
            this.SetCustomDefaultValues();
        }

        private void SetCustomDefaultValues()
        {
        }

        // Properties
        public DataGrid DataGrid
        {
            get
            {
                return this.ViewRow.DataGrid;
            }
        }

        public Brush HorizontalGridLineBrush
        {
            get
            {
                return (Brush)base.GetValue(HorizontalGridLineBrushProperty);
            }
            set
            {
                base.SetValue(HorizontalGridLineBrushProperty, value);
            }
        }

        public Visibility HorizontalGridLineVisibility
        {
            get
            {
                return (Visibility)base.GetValue(HorizontalGridLineVisibilityProperty);
            }
            set
            {
                base.SetValue(HorizontalGridLineVisibilityProperty, value);
            }
        }

        public DataGridRow Row
        {
            get
            {
                if (this.ViewRow == null)
                {
                    return null;
                }
                return this.ViewRow.Row;
            }
        }

        internal ViewRow ViewRow { get; set; }
    }
}
